package com.xxl.job.executor.service.jobhandler;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.Optional;

/**
 * @version 1.0
 * @Author liujinchi
 * @Date 2023/5/24 13:35
 * @注释
 */
public class Test2 {
    public static void main(String[] args) {

        ArrayList<Object> objects = new ArrayList<>();

        Date date  = new Date();
        Date date1 = new Date();
        date1.setTime(1684909998284L);

        Date date2 = new Date(1684909998200L);

        ArrayList<Date> dates = new ArrayList<Date>();

        dates.add(date);
        dates.add(date1);
        dates.add(date2);
        Optional<Date> max = dates.stream().max(Comparator.comparing(p -> p));
        Date date3 = max.get();

        System.out.println(date3);

    }
}
